/*
 *
 *
 */
#include "TimeCounter.h"

#ifndef _TIMECOUNTER_CPP_
#define _TIMECOUNTER_CPP_


/*
 *
 */
TimeCounter::TimeCounter(void)
{
    
}

/*
 *
 */
TimeCounter::~TimeCounter(void)
{

}

/*
 *
 */
void TimeCounter::start(void)
{
    initialTime = SDL_GetTicks();
    paused = false;
}

/*
 *
 */
void TimeCounter::stop(void)
{
    pauseTime = SDL_GetTicks();
    paused = true;
}

/*
 *
 */
void TimeCounter::resume(void)
{
    initialTime += SDL_GetTicks() - pauseTime;
    paused = false;
}

/*
 *
 */
int TimeCounter::getTime(void)
{
    if(paused)
    {
        return SDL_GetTicks() - pauseTime;
    }
    else
    {
        return SDL_GetTicks() - initialTime;
    }
}

#endif

